﻿
using System;
using System.Drawing;

namespace Marmat.Forms
{
    /// <summary>
    /// 异步函数执行过程中,提示内容的更新支持
    /// </summary>
    public class AsyncHelperEventArgs
    {
        internal AsyncHelperEventArgs(AsyncHelperForm form)
        {
            this._form = form;
        }

        readonly internal AsyncHelperForm _form;

        /// <summary>
        /// 获取或设置等待窗口的标签文字
        /// </summary>
        /// <returns></returns>
        public string Text
        {
            get => this._form.Text;
            set => this._form.Invoke(new Action(() => this._form.Text = value));
        }

        /// <summary>
        /// 获取或设置等待窗口的图标
        /// </summary>
        /// <value></value>
        /// <returns></returns>
        /// <remarks></remarks>
        public Image Image
        {
            get => this._form.PictureBox1.Image;
            set => this._form.Invoke(new Action(() => this._form.PictureBox1.Image = value));
        }
    }
}